




var router = require("express").Router();

var Student = require("../modules/db/student");



router.get("/addstu", function(req, res) {

    var stu = new Student(req.query);
    // 向数据库插入一条数据
    stu.save(function(err,data) {
      if (err) {
        console.log(err);
        res.json({ error: 1, txt: "保存失败" });
      } else {
        res.json({ error: 0, txt: "保存成功" });
      }
    });
  });




  module.exports = router;


